<?php

class Core_Html_Form extends Kd_Html_Form {

    public function addIndustryField($label, $id, $name, $required = FALSE) {
        $field = $this->createField($label, $required, "field_$id");
        $result = new Core_Html_Form_Industry();
        $result->setId($id)->setName($name? $name: $id);
        $field->setInput($result);
        return $result;
    }

    public function addRoadField($label, $id, $name, $required = FALSE) {
        $field = $this->createField($label, $required, "field_$id");
        $result = new Core_Html_Form_Road();
        $result->setId($id)->setName($name? $name: $id);
        $field->setInput($result);
        return $result;
    }

    public function addFileBrowserField($label, $id, $name, $required = FALSE) {
        $field = $this->createField($label, $required, "field_$id");
        $result = new Core_Html_Form_FileBrowser();
        $result->setId($id)->setName($name? $name: $id);
        $field->setInput($result);
        return $result;
    }

    public function addComboTreeField($label, $id, $name, $required = FALSE){
        $field = $this->createField($label, $required, "field_$id");
        $result = new Core_Html_Form_ComboTree();
        $result->setId($id)->setName($name? $name: $id);
        $field->setInput($result);
        return $result;
    }
//
//    public function addMultitextField($label, $id, $name, $required = FALSE){
//        $field = $this->createField($label, $required, "field_$id");
//        return $field->createInput('multitext', $id, $name);
//    }

    public function addPoiBrowserField($label, $id, $name, $required = FALSE){
        $field = $this->createField($label, $required, "field_$id");
        $result = new Core_Html_Form_PoiBrowser();
        $result->setId($id)
               ->setName($name? $name: $id);
        $field->setInput($result);
        return $result;
    }
}